package general;

class GenEvent
{

    public static function extended(str : String)
    {
        #if neko
            var outstr = new neko.io.StringOutput();
            outstr.writeChar(0);
            outstr.writeInt32(str.length);
            return outstr.toString()+str;
        #else flash9
            var out = new flash.utils.ByteArray();
            out.endian = flash.utils.Endian.LITTLE_ENDIAN;
            out.writeByte(0);
            out.writeInt(str.length);
            out.writeUTFBytes(str);
            return out;
        #end
    }

}